{{ trigger.call("before_page_fields") }}
{% set field_markdown = site.enable_markdown ? " data-markdown" : "" %}
<p class="main_options">
<label for="title">{{ "Title" | translate }}</label>
<input class="text" type="text" name="title" value="{{ page is defined ? page.title | fix(true, true) : '' }}" id="title" required>
</p>
<p class="main_options">
<label for="body">
{{ "Body" | translate }}
</label>
<span id="body_toolbar" class="options_toolbar text_block_toolbar" role="toolbar">
{%- if field_markdown -%}
<a href="{{ url('help/id/markdown') }}" target="_blank" class="help emblem markdown">
{{- icon_svg("markdown.svg", "Markdown" | translate) -}}
</a>
{%- endif -%}
</span>
<textarea rows="10" name="body" id="body" data-preview{{ field_markdown }} required>{{ page is defined ? page.body | fix(false, true) : "" }}</textarea>
<span id="body_tray" class="options_tray" role="status"></span>
</p>
{{ trigger.call("after_page_fields") }}
<div id="more_options" class="more_options">
<p class="more_options_option">
<label for="slug">
{{ "Slug" | translate }}
<a href="{{ url('help/id/slugs') }}" rel="help" target="_blank" class="help emblem">
{{- icon_svg("help.svg", "Help" | translate) -}}
</a>
</label>
<input class="text" type="text" name="slug" value="{{ page is defined ? page.clean | fix(true) : '' }}" id="slug" maxlength="128"{{ slug_pattern() }}>
</p>
<p class="more_options_option">
<label for="status">{{ "Status" | translate }}</label>
<select name="status" id="status">
{% set page_status = page is defined ? page.status : site.default_page_status %}
{% set status_constant = constant("Page::STATUS_LISTED") %}
<option value="{{ status_constant }}"{{ status_constant | selected(page_status) }}>
{{ "Public and visible in pages list" | translate }}
</option>
{% set status_constant = constant("Page::STATUS_PUBLIC") %}
<option value="{{ status_constant }}"{{ status_constant | selected(page_status) }}>
{{ "Public" | translate }}
</option>
{% set status_constant = constant("Page::STATUS_TEASED") %}
<option value="{{ status_constant }}"{{ status_constant | selected(page_status) }}>
{{ "Private and visible in pages list" | translate }}
</option>
{% set status_constant = constant("Page::STATUS_PRIVATE") %}
<option value="{{ status_constant }}"{{ status_constant | selected(page_status) }}>
{{ "Private" | translate }}
</option>
</select>
</p>
<p class="more_options_option">
<label for="list_priority">{{ "Priority in pages list" | translate }}</label>
<select name="list_priority" id="list_priority">
{% set page_list_order = page is defined ? page.list_order : 4 %}
<option value="0"{{ page_list_order | selected(0,1,2) }}>
{{ "High" | translate }}
</option>
<option value="4"{{ page_list_order | selected(3,4,5) }}>
{{ "Medium" | translate }}
</option>
<option value="8"{{ page_list_order | selected(6,7,8) }}>
{{ "Low" | translate }}
</option>
</select>
</p>
<p class="more_options_option">
<label for="parent_id">{{ "Parent" | translate }}</label>
<select name="parent_id" id="parent_id">
<option value="0">{{ "[None]" | translate }}</option>
{% set page_parent_id = page is defined ? page.parent_id : 0 %}
{% for item in theme.pages_list(0, page is defined ? page.id : null) %}
<option value="{{ item.id }}"{{ item.id | selected(page_parent_id) }}>
{{ item.title | striptags | fix }}
</option>
{% endfor %}
</select>
</p>
{% if route.action == "write_page" %}
{{ trigger.call("new_page_options") }}
{% else %}
{{ trigger.call("edit_page_options", page) }}
{% endif %}
</div>
<div class="buttons confirmation">
{% if route.action == "write_page" %}
<button type="submit" class="yay">
{{ "Publish" | translate }}
</button>
<button type="submit" name="private" value="true">
{{ "Save" | translate }}
</button>
{% else %}
<button type="submit">
{{ "Save" | translate }}
</button>
<button type="submit" class="boo" name="cancel" value="true" data-confirm="">
{{ "Cancel" | translate }}
</button>
{% endif %}
</div>
